package fishGenerator;

import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;

import math.Vector2D;
import ImageLoader.ImageLoader;
import gameEntities.Fish;
import gameEntities.GameEntityManager;
import gameEntities.MediumFish;

/**
 * The Class MediumFishGenerator generates medium fishes on one side of the game canvas.
 */
public class MediumFishGenerator extends FishGenerator {
	
	/**
	 * Instantiates a new medium fish generator.
	 *
	 * @param position the position
	 * @param depthRange the depth range where medium fishes could appear
	 * @param depthStart the minimal depth
	 * @param right if the fish generator generates fishes at the right end of the screen, or at the left
	 * @param speed the speed of the instantiated fishes
	 * @param gem the gem
	 */
	public MediumFishGenerator(Vector2D position, int depthRange, int depthStart, boolean right, float speed,
			GameEntityManager gem) {
		super(position, depthRange, depthStart, right, speed, gem);
		this.fishImg = ImageLoader.load("/mediumFish.png");
	}

	/* (non-Javadoc)
	 * @see fishGenerator.FishGenerator#CreateFish(math.Vector2D, boolean, float)
	 */
	protected Fish CreateFish(Vector2D position, boolean right, float speed) {
		// TODO Auto-generated method stub

		Sprite fishSpr = new Sprite(fishImg, 48, 22);
		fishSpr.setFrameSequence(new int[] {0, 1, 0, 2});
		fishSpr.setFrame(1);
		return new MediumFish(fishSpr, position, right, speed);
	}
	
	/** The fish img. */
	private final Image fishImg;
}
